import request from '@/request'

/** 查询热门比赛人数 */
export const getHotRaces = () =>
  request.get('/api/statistics/getHotRaces')

/** 查询本月各学院第二课堂活动数量 */
export const getSecondClassCount = (params: { month: number }) =>
  request.get('/api/statistics/getSecondClassCount/month', { params })

/** 查询今年各学院第二课堂活动数量 */
export const getSecondClassCountYear = (params: { year: number }) =>
  request.get('/api/statistics/getSecondClassCount/year', { params })

/** 统计各年级学生的参与第二课堂的活动占比 */
export const getStudentGradeCount = () =>
  request.get('/api/statistics/getStudentGradeCount')

/** 查询学生报名第二课堂活动统计 */
export const getStudentJoinCount = (userId: number) =>
  request.get('/api/statistics/getStudentJoinCount/second', { params: { userId } })

/** 查询个人年度参与活动率 */
export const getParticipationRateByUser = (userId: number, grade: number) =>
  request.get('/api/statistics/participationRateByUser', { params: { userId, grade } })

/** 查询大创申报教师指导项目数 */
export const getTeacherInstructCount = (userId: number) =>
  request.get('/api/statistics/getTeacherInstructCount/innovation', { params: { userId } })

/** 查询学科竞赛教师指导项目数 */
export const getContestTeacherInstructCount = (userId: number) =>
  request.get('/api/statistics/getTeacherInstructCount/contest', { params: { userId } })

/** 查询第二课堂教师指导项目数 */
export const getSecondTeacherInstructCount = (userId: number) =>
  request.get('/api/statistics/getTeacherInstructCount/second', { params: { userId } })

/** 查询学生参与第二课堂活动统计 */
export const getStudentSecondClassCount = (userId: number) =>
  request.get('/api/statistics/getStudentJoinCount/activity', { params: { userId } })

/** 查询学生参与大创活动统计 */
export const getStudentInnovationCount = (userId: number) =>
  request.get('/api/statistics/getStudentJoinCount/innovation', { params: { userId } })

/** 查询第二课堂热门活动类型数量 */
export const getSecondHotRace = () =>
  request.get('/api/statistics/getSecondHotRace')
